Skip to content

ci: replace msvc-dev-cmd with WIP vanilla bat - #409

Open
VJanKraemer wants to merge 2 commits into
mainfrom
remove_msvc_cmd
Open

ci: replace msvc-dev-cmd with WIP vanilla bat#409
VJanKraemer wants to merge 2 commits into
mainfrom
remove_msvc_cmd

Conversation

@VJanKraemer

Copy link
Copy Markdown
Contributor

Subject

redudece third party dependencies in CI

Description

msvc-dev-cmd is the only (non github) third party depency we have in our CI. And while not critical we want to experiment with vanilla setups for the CI

Instructions for review / testing

Developer checklist (address before review)

  • Changelog.md updated
  • Prepared update for depending repositories
  • Documentation updated (public API changes only)
  • API docstrings updated (public API changes only)
  • Rebase → commit history clean
  • Squash and merge → proper PR title

Comment thread SilKit/ci/setup_msvc_env.py Outdated

new_env = vsdevcmd_proc.stdout
logger.debug(f"New Env:\n{new_env}")
logger.debug(f"Old End: \n{json.dumps(dict(os.environ), indent=2)}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.debug(f"Old End: \n{json.dumps(dict(os.environ), indent=2)}")
logger.debug(f"Old Env: \n{json.dumps(dict(os.environ), indent=2)}")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread SilKit/ci/setup_msvc_env.py Outdated
def find_VsDevCmd() -> str:

some_out = subprocess.run(
["vswhere", "-version", "[17.0, 17.9)", "-property", "InstallationPath"],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should result in the absolute path to the VsDevCmd.bat file directly:

Suggested change
["vswhere", "-version", "[17.0, 17.9)", "-property", "InstallationPath"],
["vswhere", "-latest", "-find", "Common7\Tools\VsDevCmd.bat"],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread SilKit/ci/setup_msvc_env.py Outdated
Comment on lines +32 to +34
vs_path = find_VsDevCmd()

vsdevcmd_path = vs_path / r'Common7\Tools\VsDevCmd.bat'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vs_path = find_VsDevCmd()
vsdevcmd_path = vs_path / r'Common7\Tools\VsDevCmd.bat'
vsdevcmd_path = find_VsDevCmd()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

logger.error("Could not acquire a new shell env!")
exit(1)

environment = json.loads(vsdevcmd_proc.stdout)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before 'publishing' the new environment to GITHUB_ENV, we should filter out any environment variable starting with GITHUB_, RUNNER_, and the CI variable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@VJanKraemer
VJanKraemer force-pushed the remove_msvc_cmd branch 2 times, most recently from e0b3d0b to a2db728 Compare August 20, 2026 13:35
In order to minimize 3rd party dependencies we replaced the msvc-dev-cmd
action with a python script.

Signed-off-by: Jan Kraemer <jan.kraemer@vector.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants